<div style="font-size:10pt;" class="color">
    <a href="{url link='public.groups'}">{language text="groups"}</a>
    &gt;&gt;
    <a href="{url link='public.groups.view' id=$aGroupData.id}">{$aGroupData.title|escape}</a>
    &gt;&gt;
    {language text='group_invite_951'}
</div>
<br />
<table style="width: 100%;" cellpadding="4" cellspacing="0">
    <tr>
        <td class="border2" valign="top">


        <table style="width: 100%;" class="mainmenu5" cellpadding="0" cellspacing="0" border="0">
        <tr>
            <td width="7"><img src="design/pic/spacer.gif" class="sqr1" alt="" height="7" width="7" /></td>
            <td class="block_header">{language text="group_invite"}</td>
        </tr>
        </table>

        {if (!($isOwner OR $isAdmin)) AND (!$isFreeInvite)}
        	{language text="invites_cant_be_made_in_this_group"} <br />
        	{language text="access_is_only_permited_to_the_grou"}.
        	<ul>
        		<li><a href="{url link='public.groups' id=$aGroupData.id}">{language text="go_to_group_profile"}</a></li>
        		<li><a href="{url link='public.groups'}">{language text="return_to_group_index"}</a></li>
        	</ul>
        {else}
        	{if $iUserCnt == 0 AND $iEmailCnt == 0 AND $iProcessing}
        		{language text="sorry_you_did_not_enter_any_valid_e"}
        		<ul>
        			<li><a href="javascript:history.go(-1);">{language text="go_back"}</a></li>
        		</ul>
        	{elseif $iUserCnt !=0 OR $iEmailCnt !=0 AND $iProcessing}
        				<div style="padding:10px;font-size:10pt;">

        				{if $iUserCnt != 0}
        					{language text="you_have_invited_the_following_memb"}:
        					<ul>
        						{foreach from=$aInviteMembers item=sUser}
        							<li><a href="{url link='public.user' name=$sUser}">{$sUser}</a></li>
        						{/foreach}
        					</ul>
        				{/if}

        				{if $iEmailCnt != 0}
        					{if $isEmailErrors}
        						{language text="sorry_you_did_not_enter_any_valid_e_955"}
        					{else}
        						{str_replace text="`you_have_sent_out_iemailcnt_email_s`" iEmailCnt="`$iEmailCnt`" }
        					{/if}
        				{/if}

        				</div>
        				<ul>
        				<li><a href="{url link='public.groups.invite' id=$aGroupData.id}">{language text="send_more"}</a></li>
        				<li><a href="{url link='public.groups.view' id=$aGroupData.id}">{language text="go_to_group"}</a></li>
        				</ul>
        	{else}

        	<div style="padding:5px;">

        		<br /><br />

        		{literal}
        		<script type="text/javascript">

        		function selectSendboxAll()
        		{
        		    var oSel = document.getElementById('listRight');
        		    for (var i = 0; i < oSel.options.length; i++)
        		    {
        		        oSel.options[i].selected = true;
        		    }
        		}

        		function change_pic(image,user)
        		{
        			document.getElementById('user_pic').height=75;
        			document.getElementById('user_pic').src=image;
        			document.getElementById('name').innerHTML=user;
        		}

        		function check_option()
        		{
        			var item = document.getElementById('listRight');

        			if (item.value != "")
        			{
        			{/literal}
        				alert("{language text="you_send_box_is_full_you_must_eithe"}");
        			{literal}
        				return false;
        			}

        			document.getElementById('newform').submit();

        			return true;
        		}

				function getFriends()
				{
					new Effect.Appear('ajax_main_image');
					document.getElementById('update_check').innerHTML='';
					{/literal}
					xajax_getFriends(document.getElementById('userid').value, '{$aGroupData.id}');
					{literal}
					return false;
				}

				function checkEnterKey(event)
				{
					if ((event.which && event.which == 13) || (event.keyCode && event.keyCode == 13))
					{
						getFriends();
						return false;
					}

					return false;
				}

				function startInvite(iId)
				{
					{/literal}
					document.getElementById(iId).innerHTML=' <img src="design/pic/loader.gif" alt="" style="vertical-align:middle;" /> {language text="Mod_Groups.ajax.inviting"} ';
					{literal}
				}

        		</script>
        		{/literal}

				{if $bAjax}
        		<div style="padding:2px;" class="border2">
        		<div class="border13" style="padding:5px;font-size:9pt;">
	       			<b>{language text="Mod_Groups.search.users"}:</b>
        		</div>
        		</div>

        		<br />

        		<div style="padding:4px;font-size:10pt;">

        		{language text="Mod_Groups.invite.username"}:

        		<input onkeydown="checkEnterKey(event);" id="userid" type="text" name="aUser[user]" value="{$aUser.user}" maxlength="25" size="20" />

				<span id="check_ajax_user"></span>
				<span id="check_username">
					<input type="button" value="{language text='Mod_Groups.submit.search'}" name="checkUsername" style="cursor:pointer;" onclick="return getFriends();" />
					<span id="ajax_main_image" style="display:none;font-size:10pt;font-weight:bold;">
						<img src="design/pic/loader.gif" alt="" style="vertical-align:middle;" /> {language text="Mod_Groups.ajax.searching"}
					</span>
				</span>

				<div id="update_check" style="display:none;"></div>
				<div id="user_content"></div>

				</div>

        		<br />
        		<br />
        		{/if}

        		<div style="padding:2px;" class="border2">
        		<div class="border13" style="padding:5px;font-size:9pt;">
	       			<b>{language text="Mod_Groups.select.friends"}:</b>
        		</div>
        		</div>

        		<table>
        		<tr>
        		<td style="font-size:8pt;">

        		<span id="name"></span><br />
        		<img src="design/pic/spacer.gif" alt="" width="75" height="0" id="user_pic" />
        		</td><td style="vertical-align:bottom;font-size:8pt;" class="color">

        		<form action="{url link='public.groups.invite' id=$aGroupData.id}" method="post" id="newform">
        		<div><input type="hidden" name="link" value="invite" /></div>
        		<b>{language text="page_listing"}:</b>

        		<select style="width:150px;" name="page" onchange="return check_option();">
        			<option value="">{$iFrom} - {$iTo}</option>
        			{foreach from=$aPages item=aItem}
        			<option value="{$aItem}">Page: {$aItem}</option>
        			{/foreach}
        		</select>
        		</form>

        		</td>
        		</tr>
        		</table>

        		<script type="text/javascript" src="design/js/select.js"></script>

        		<form action="{url link='public.groups.invite' id=$aGroupData.id act=invite}" method="post" name="myForm">
        		<table cellpaddin="2">
        		<tr>
        			<td style="font-size:8pt;" class="border2">
        			<div class="mainmenu5">
        				<div style="padding:5px;font-size:9pt;">
        				<b>{language text="friendbox"}</b>
        				</div>
        			</div>

        			<select multiple size="7" style="width:150px;" name="listLeft">
        				{foreach from=$aFriends item=aItem}
        			    	<option value="{$aItem.user}" onclick="change_pic('{$sImageUrl}{$aItem.user}_75.jpg','{$aItem.user}');">{$aItem.user}</option>
        			    {/foreach}
        		    	</select>
        			</td><td>
        			<input type="button" style="width:120px;" onclick="moveDualList( this.form.listLeft,  this.form.listRight, false );"  name="Add     &gt;&gt;"  value="{language text="add"}       &gt;&gt;">
        			<br /><br />
        			<input type="button" style="width:120px;" onclick="moveDualList( this.form.listRight, this.form.listLeft,  false )"  name="&lt;&lt;      Remove"  value="&lt;&lt;      {language text="remove"}">
         			</td>
                    <td class="border2">
            			<div class="mainmenu5">
            				<div style="padding:5px;font-size:9pt;">
            				<b>{language text="sendbox"}</b>
            				</div>
            			</div>
            			<select multiple size="7" style="width:150px;" name="listRight[]" id="listRight"></select>
        			</td>
        		</tr>
        		</table>

        		<br /><br />


        		<div style="padding:2px;" class="border2">
        		<div class="border13" style="padding:5px;font-size:9pt;">
	       			<b>{language text="send_out_emails"}:</b>
        		</div>
        		</div>
        		<div style="text-align:center;padding:4px;font-size:8pt;">
        			<textarea cols="40" rows="5" name="emails" style="width:90%;"></textarea>
        			<div style="padding:8px;">
        				({language text="seperate_with_comas"} , )
        			</div>
        		</div>

        		<div style="padding:5px;text-align:center;">
        			<input type="submit" value="  {language text="invite_12"}  " style="cursor:pointer;font-size:12pt;" class="mainmenu6" onmouseover="this.className='mainmenu7';" onmouseout="this.className='mainmenu6';" onclick="javascript: selectSendboxAll();" />
        		</div>

        		</form>


        		</div>
        	{/if}
        {/if}
    </td>
</tr>
</table>